<template>
    <div class="store-header">
        <!--<mt-navbar v-model="selected">-->
        <!--<mt-tab-item id="1">option A</mt-tab-item>-->
        <!--<mt-tab-item id="2">option B</mt-tab-item>-->
        <!--<mt-tab-item id="3">option C</mt-tab-item>-->
        <!--</mt-navbar>-->
        <div class="store-header-wrap" v-if="Object.keys(storeMsg).length > 0">
            <div class="width-full">
                <v-header
                        class="store-header-banner"
                        ref="refHeader"
                        v-if="storeMsg && Object.keys(storeMsg).length > 0"
                        :headerProp="getHeaderItem()"
                        @doAttention="doAttention"
                        @showShare="shareShow"
                ></v-header>
            </div>
            <div class="positionR displayFlex">
                <div class="hidden-scroll">
                    <div class="displayFlex flex1 store-header-wlist user-touch" ref="headerBanner">
                        <ul class="store-header-list positionR">
                            <!--                            <li v-for="(value,key) in menus" ref="menuItem" class="store-item positionR" @click="showMenuItem({menuType:value.menuType,menuId:value.menuId,isClick:true})" :class="{active:value.defaultShow}">-->
                            <!--                                <span class="positionR">-->
                            <!--                                    {{value.name}}-->
                            <!--                                    &lt;!&ndash;不需要下划线了&ndash;&gt;-->
                            <!--                                    <span class="under-line" v-if="false && value.defaultShow"></span>-->
                            <!--                                </span>-->
                            <!--                            </li>-->
                            <li v-for="(value,key) in menus" ref="menuItem" class="store-item positionR"
                                :class="{active:value.menuType == menuType && menuId == value.menuId}"
                                @click="tapmenu(value,true)">
                                <span class="positionR">
                                    {{value.name}}
                                </span>
                            </li>
                        </ul>
                    </div>
                </div>
                <!--<div class="store-item-right">-->
                <!--<router-link class="iconfont icon-arrows_right" :to="{path:'/home'}"></router-link>-->
                <!--</div>-->
            </div>
        </div>
        <router-view v-if="showChild"/>
        <!--这种方式不符合路由的配置规则，但是也没事，可以用-->
<!--        <div class="content-wrap" v-for="(value,key) in menus"-->
<!--             v-if="tMenuType == value.menuType && value.menuId == tMenuId ">-->
<!--            <store-panorama-->
<!--                    v-if="tMenuType==1"-->
<!--                    :rtCommontProps="panorama.rtCommont"-->
<!--                    :commentListProps="commentListProps"-->
<!--                    :panoramaMediaProps="panorama.panoramaMsg"-->
<!--                    :discountListProp="discountList"-->
<!--                    @getUserMainComment="getUserMainComment"-->
<!--                    @isLike="isLike"-->
<!--                    @getSubCommentList="getSubCommentList"-->
<!--                    @doComment="doComment"-->
<!--            >-->
<!--            </store-panorama>-->
<!--            &lt;!&ndash;                    v-if="tMenuType==1 && activity.activityMsg.list && activity.activityMsg.list.length > 0"&ndash;&gt;-->
<!--            <store-activity-->
<!--                    v-else-if="tMenuType==2 && Array.isArray(activity.activityMsg.list) && activity.activityMsg.list.length > 0"-->
<!--                    :rtCommontListProps="activity.rtCommont"-->
<!--                    :commentListProps="commentListProps"-->
<!--                    :swiperContentProp="activity.activityMsg"-->
<!--                    :couponsListProp="couponsList"-->
<!--                    @initGoodsMsg="initActivityMsg"-->
<!--                    @isLike="isLike"-->
<!--                    @doComment="doComment"-->
<!--                    @showShare="share=true"-->
<!--                    @getSubCommentList="getSubCommentList"-->
<!--                    @getUserMainComment="getUserMainComment"-->
<!--                    @suspensionCb="suspensionCb"-->
<!--                    @getAllCounponsFn="getAllCounponsFn"-->
<!--                    @animationCb="animationCb"-->
<!--                    @openRedPage="openRedPage"-->
<!--                    @getTemplate="getTemplate"-->
<!--            >-->
<!--            </store-activity>-->
<!--            &lt;!&ndash;                    v-if="tMenuType==2 && goods.rtCommont && Object.keys(goods.rtCommont).length > 0"-->
<!--&ndash;&gt;-->
<!--            <store-goods-->
<!--                    v-else-if="tMenuType==3 && goods.rtCommont && Object.keys(goods.rtCommont).length > 0"-->
<!--                    ref="storeGoods"-->
<!--                    :rtCommontProps="goods.rtCommont"-->
<!--                    :commentListProps="commentListProps"-->
<!--                    :storeGoodsMsgProp="goods.goodsMsg"-->
<!--                    :storeMsg="storeMsg"-->
<!--                    :discountListProp="discountList"-->
<!--                    @initGoodsMsg="initGoodsMsg"-->
<!--                    @isLike="isLike"-->
<!--                    @doComment="doComment"-->
<!--                    @showShare="share=true"-->
<!--                    @getSubCommentList="getSubCommentList"-->
<!--                    @getUserMainComment="getUserMainComment"-->
<!--            ></store-goods>-->
<!--            &lt;!&ndash;                    v-if="tMenuType==3 && comment.commontMsg.list && comment.commontMsg.list.length > 0"-->
<!--&ndash;&gt;-->
<!--            <store-comment-->
<!--                    v-else-if="tMenuType==4 && Array.isArray(comment.commontMsg.list) && comment.commontMsg.list.length > 0"-->
<!--                    :rtCommontListProps="comment.rtCommont"-->
<!--                    :commentListProps="commentListProps"-->
<!--                    :swiperContentProp="comment.commontMsg"-->
<!--                    @initGoodsMsg="initCommentMsg"-->
<!--                    @isLike="isLike"-->
<!--                    @doComment="doComment"-->
<!--                    @showShare="share=true"-->
<!--                    @getSubCommentList="getSubCommentList"-->
<!--                    @getUserMainComment="getUserMainComment"-->
<!--            >-->
<!--                <div slot="swiperIn" slot-scope="swiperItem">-->
<!--                    <video-float-footer-->
<!--                            :bottomSuspensionProp="Object.assign({},swiperItem.swiperItem,{type:'buyShow'})"-->
<!--                    ></video-float-footer>-->
<!--                </div>-->
<!--            </store-comment>-->
<!--            &lt;!&ndash; && Array.isArray(master.masterMsg.list) && master.masterMsg.list.length > 0&ndash;&gt;-->
<!--            <store-master-->
<!--                    ref="master"-->
<!--                    v-else-if="tMenuType==5 && masterState.show"-->
<!--                    :rtCommontListProps="masterState.rtCommont"-->
<!--                    :commentListProps="commentListProps"-->
<!--                    :swiperContentProp="masterState.masterMsg"-->
<!--                    @initGoodsMsg="initBigMaster"-->
<!--                    @isLike="isLike"-->
<!--                    @doComment="doComment"-->
<!--                    @showShare="share=true"-->
<!--                    @getSubCommentList="getSubCommentList"-->
<!--                    @getUserMainComment="getUserMainComment"-->
<!--                    @suspensionCb="suspensionCb"-->
<!--                    @getAllCounponsFn="getAllCounponsFn"-->
<!--                    @animationCb="animationCb"-->
<!--                    @openRedPage="openRedPage"-->
<!--                    @getTemplate="getTemplate"-->
<!--                    @showMarsterDetail="showMarsterDetail"-->
<!--                    @showMarsterClassify="showMarsterClassify"-->
<!--            >-->
<!--                <div slot="swiperOut"-->
<!--                     v-if="bottomSuspensionShow && masterState.masterMsg && Array.isArray(masterState.masterMsg.list) && masterState.masterMsg.list.length > 0">-->
<!--                    <bottom-suspension-->
<!--                            ref="bottomSuspension"-->
<!--                            v-for="(value,key) in masterState.masterMsg.list"-->
<!--                            :key="key"-->
<!--                            v-if="swiperIndex == key"-->
<!--                            :masterFooterProp="value.bottomSuspension.content"-->
<!--                            @toSwiperIndex="toSwiperIndex"-->
<!--                    ></bottom-suspension>-->
<!--                </div>-->
<!--            </store-master>-->
<!--            &lt;!&ndash;直播&ndash;&gt;-->
<!--            <play-direct v-else-if="tMenuType == 6 && playChannel && playChannel.chatRoomId"-->
<!--                         :neplayerProp="playChannel"-->
<!--                         :discountList="discountList"-->
<!--                         :storeMsg="storeMsg"-->
<!--                         @showShare="share=true"-->
<!--            ></play-direct>-->
<!--            &lt;!&ndash;            {{playChannel}}playChannel&ndash;&gt;-->
<!--        </div>-->
<!--        <v-share v-if="share" @clickFn="share=false"></v-share>-->
        <v-share v-if="shareBordShow" @clickFn="shareShow(false)"></v-share>
<!--        <wx-share-body v-if="menuType !== '1'"></wx-share-body>-->
    </div>
</template>

<script>
    // import {Navbar, TabItem} from 'mint-ui';
    import XLocation from "../../x/XLocation";
    // import storeActivity from './StoreSwiper';
    // import FullImgVideoSwiper from "../../components/commonActModel/panoramaVideoSwiper/FullImgVideoSwiper";
    // import PlayDirect from "./PlayDirect";
    // import StorePanorama from "./StorePanorama";
    // import StoreGoods from "./StoreGoods";
    // import Vue from 'vue';
    import {mapMutations, mapState, mapGetters} from 'vuex';

    export default {
        name: "StoreHome",
        data() {
            return {
                menuType: '',
                selected: '1',
                tMenuType: 0,
                tMenuId: 0,
                storeMsg: {},
                // storeId:591,
                storeId: '', //店铺ID
                commentListProps: {userHendleType: 'module5'},//侧边栏评论分享等
                commentKey: 0,
                commentType: 1,
                commentPageNum: 1,
                commentPageSize: 10,
                praiseRate: 0,
                giveChannel: 1,//好玩页面0，商家页面1
                isInit: true,//是否为首次加载，不是首次加载删除shareId
                share: false,
                shareBody: {},
                couponsList: [],
                discountList: [],//距离
                menus: [],//页面导航栏
                swiperIndex: 0,
                bottomSuspensionShow: false,//大师是否显示
                showChild:true,//处理vue子路由无法跳转的bug
                panorama: {
                    rtCommont: {
                        isNeedServer: false
                    },
                    panoramaMsg: {
                        mediaContents: [],
                        mediaType: '',
                    },
                },
                activity: {
                    rtCommont: [],
                    activityMsg: {
                        list: []
                    },
                },
                commontType: 2,/*0:主评论  1：子评论 2: 店铺实景 3：店铺商品 4：店铺活动 5： 店铺品牌 10:多媒体信息*/
                goods: {
                    rtCommont: {},
                    goodsMsg: {
                        pageSize: 10,
                        pageNum: 1,
                    },
                },
                comment: {
                    rtCommont: {},
                    commontMsg: {
                        pageSize: 10,
                        curPage: 1,
                    },

                },
                master: {
                    rtCommont: [],
                    masterMsg: {
                        list: []
                    },
                    show: false,
                },

            }
        },
        created() {
            /*微信登录*/
            // if (!this.isLogin()) {
            //     this.toThirdLogin();
            // }
            this.storeMsgInit();
            this.$store.commit('createNeplayerRoom')
        },
        computed: {
            ...mapState({
                masterState: state => state.logic.masterBoxsObj,
                playChannel: state => state.api.playChannelMsg,
                // nim:state=> state.logic.groupChat.nim,
                groupChat: state => state.logic.groupChat,
                shareBordShow: state => state.logic.shareBordShow,
            }),
            ...mapGetters({
                currentStore: 'currentStoreFn',
                storeMenu:'getterStoreMenu',
            })
        },
        mounted() {
        },
        methods: {
            ...mapMutations(['masterListApi', 'playChannelApi', 'merStoreGetStoreInfo', 'updateStoreMenu','shareShow']),
            storeMsgInit() {
                let that = this;
                this.storeId = this.$route.query && this.$route.query.storeId ? this.$route.query.storeId : null;
                this.menuType = this.$route.query && this.$route.query.menuType ? this.$route.query.menuType : 0
                this.menuId = this.$route.query && this.$route.query.menuId ? this.$route.query.menuId : 0;
                let tempObj = {};
                //菜单类型：1纯媒体 2活动 3商品 4买家秀 5大师
                /*获取页面导航栏*/
                let getTapUrl = `${this.NW_API_API_LOCALE_VERSION}/store/website/menu/list?storeId=${this.storeId}`
                // menus
                this.xurl.getLoading(getTapUrl).then((data) => {
                    if (data.success) {
                        that.menus = data.list;
                        if ((!that.menuId && that.menuType !== 3) || !that.menuType) {
                            setMenuId(data);
                        } else if (that.menuType == 3) {
                            data.list.forEach((value, index) => {
                                if (data.list[index].menuType == 3) {
                                    that.menuId = data.list[index].menuId;
                                    that.menuType = data.list[index].menuType;
                                }
                            })
                        } else if (that.menuId || that.menuType) {
                            let menus = '';
                            let menuType = '';
                            if (that.menuId) {
                                menus = that.menus.every((menusVal) => {
                                    return menusVal.menuId != that.menuId
                                })
                            }
                            if (that.menuType) {
                                menuType = that.menus.every((menusVal) => {
                                    return menusVal.menuType != that.menuType
                                })
                            }
                            /*错误的链接的纠正方法，防止白屏*/
                            if (menus || menuType) {
                                setMenuId(data)
                            }
                        }
                        tempObj = {
                            storeId: that.storeId,
                            menuType: that.menuType,
                            menuId: that.menuId,
                            menus: that.menus,
                        };
                        this.updateStoreMenu(tempObj);
                        this.tapmenu(tempObj);
                        /*修改路由的时候注释*/
                        // that.showMenuItem(tempObj);
                    }
                })
                let params = {
                    thirdId: this.thirdId || 0,
                    userId: this.userId || 0,
                    storeId: this.storeId || 0,
                    success: storeFn,
                }

                function storeFn(data) {
                    let currentStore = that.currentStore || {};
                    that.storeMsg = data || currentStore;
                    that.praiseRate = data && data.praiseRate ? data.praiseRate : currentStore.praiseRate;
                    let tempLocation = XLocation.getLocationDiscount(data || currentStore);
                    tempLocation.then((result) => {
                        that.discountList = [];
                        console.log(tempLocation,'tempLocation');
                        setTimeout(() => {
                            that.discountList.push({
                                storeId: that.storeId,
                                discount: result,
                            })
                        }, 30)
                    });
                }

                let currentStoreId = this.currentStore && this.currentStore.storeId ? this.currentStore.storeId : 0
                if (this.$route.query && this.storeId && this.storeId != currentStoreId) {
                    this.merStoreGetStoreInfo(params);
                } else {
                    storeFn();
                }
                // let urlLocation=`${this.NW_API_API_LOCALE_VERSION}/store/simpleStore/${this.storeId}/info`
                // this.xurl.get(urlLocation).then((data)=>{
                //     if(data.success){
                //
                //     }
                // })
                function setMenuId(data) {
                    let hasDefaultShow = false;
                    for (let index = 0; index < data.list.length; index++) {
                        if (data.list[index].defaultShow) {
                            that.menuId = data.list[index].menuId;
                            that.menuType = data.list[index].menuType;
                            hasDefaultShow = true;
                            /*暂时是这样做的 登录过了而且是直播就可以默认进入，否则不能默认进入*/
                            if ((data.list[index].menuType == 6 && that.userId) || data.list[index].menuType != 6) {
                                break;
                            }
                        }
                    }
                    if (!hasDefaultShow) {
                        that.menuId = data.list[0].menuId;
                        that.menuType = data.list[0].menuType;
                    }
                }
            },
            toPath(menus) {
                //菜单类型：1纯媒体 2活动 3商品 4买家秀 5大师 6直播
                let menusType = menus.menuType;
                let path = '';
                let routePath = this.$route.path;
                console.log(routePath,'routePath')
                switch (menusType) {
                    case 1:
                        path = '/store/panorama/' + this.random4Num();
                        // if(routePath.includes('/store/panorama/')){
                        //     path = routePath;
                        // }
                        break;
                    case 2:
                        path = '/store/promotion/' + this.random4Num();
                        break;
                    case 3:
                        path = '/store/goods/' + this.random4Num();
                        break;
                    case 4:
                        path = '/store/buyShow/' + this.random4Num();
                        break;
                    case 5:
                        path = '/store/master/' + this.random4Num();
                        break;
                    case 6:
                        path = '/store/playDirect/' + this.random4Num();
                        break;
                    default :
                        break;
                }
                return path
            },
            showMenuItem(obj) {
                if (obj && obj.isClick && this.menuType && obj.menuType == this.menuType) {
                    return;
                }
                let that = this;
                let scrollPosition = 0;
                that.menus.forEach((value, index) => {
                    if (value.menuId == obj.menuId) {
                        that.menus[index].defaultShow = true;
                        that.tMenuType = Number(obj.menuType);
                        that.tMenuId = Number(obj.menuId);
                        setTimeout(() => {
                            if (that.$refs.menuItem && that.$refs.menuItem[index]) {
                                scrollPosition = that.$refs.menuItem[index].offsetLeft;
                                that.$refs.headerBanner.scrollLeft = scrollPosition - document.documentElement.clientWidth / 375 * 80;
                            }
                        }, 100)
                    } else {
                        that.menus[index].defaultShow = false;
                    }
                    that.menus[index] = Object.assign({}, that.menus[index]);
                });
                that.menus.splice(0, 1, that.menus[0]);
                that.commentType = obj.menuType;
                //菜单类型：1纯媒体 2活动 3商品 4买家秀 5大师 6直播
                // if (obj.menuType == 1) {
                //     that.initMedio(obj);
                // } else if (obj.menuType == 2) {
                //     that.initActivityMsg(obj);
                // } else if (obj.menuType == 3) {
                //     that.initGoodsMsg(obj);
                // } else if (obj.menuType == 4) {
                //     that.initCommentMsg(obj);
                // } else if (obj.menuType == 5) {
                //     that.initBigMaster(obj);
                // } else if (obj.menuType == 6) {
                //     that.initPlayerDirect(obj)
                // }
            },
            // initMedio(obj) {
            //     let that = this;
            //     this.tapList(obj);
            //     /*commentType 0:多媒体信息 1：店铺实景内容 2：店铺活动 3：店铺商品 4： 商家主页品牌*/
            //     this.shareType = 1;//----分享类型：1：店铺官网媒体，2：店铺活动 3：店铺商品 4： 买家秀 5：大师
            //     let shareId = 1; //----对应分享类型需要传的ID： 1： 媒体ID 2： 活动id 3:商品id 4:买家秀ID 5: 大师ID
            //     let queryUserId = '';
            //     let query = {
            //         storeId: that.storeId,
            //         menuId: obj.menuId,
            //     }
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/store/website/media/info`;
            //     this.xurl.get(url, query).then((data) => {
            //         if (data.success) {
            //             /*这里暂时认为实景是一个张图片或者为一个视频，多个图片的情况和多个视频的情况暂时不考虑*/
            //             if (data.result) {
            //                 this.commentKey = data.result.id;
            //                 this.$store.commit('getmediaId', this.commentKey);
            //                 let tempObj = {
            //                     mediaContents: data.result.mediaContents,
            //                     mediaType: data.result.mediaType,
            //                     poster: data.result.poster,
            //                 };
            //
            //                 function getPanoramaMsg(shareBody) {
            //                     that.panorama.panoramaMsg = Object.assign({}, that.panorama.panoramaMsg, {shareBody: shareBody})
            //                 }
            //
            //                 // if( this.panorama.panoramaMsg.mediaType == 0 ){
            //                 //     tempObj.isVideo = true;
            //                 // }else if( this.panorama.panoramaMsg.mediaType == 1 ){
            //                 //     tempObj.isSwiper = true;
            //                 // }else if( this.panorama.panoramaMsg.mediaType == 2 ){
            //                 //     tempObj.isPanorama = true;
            //                 // }
            //                 this.panorama.panoramaMsg = Object.assign({}, this.panorama.panoramaMsg, tempObj);
            //                 this.panorama.rtCommont = data.result;
            //             }
            //         } else if (data.errMsg) {
            //             this.$root.$emit({msg: data.errMsg})
            //         } else {
            //             this.$root.$emit({msg: "获取页面信息失败"})
            //         }
            //     });
            // },
            // initActivityMsg(obj) {
            //     let that = this;
            //     this.tapList(obj);
            //     let queryUserId = '';
            //     this.shareType = 2;
            //     let shareId = 2; //----对应分享类型需要传的ID： 1： 媒体ID 2： 活动id 3:商品id 4:买家秀ID 5: 大师ID
            //     let params = {
            //         "pageNum": 1,
            //         "pageSize": 5,
            //     };
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/promotion/user/${this.userId}/store/${this.storeId}/list`;
            //     this.xurl.get(url, params).then((data) => {
            //         if (data.success) {
            //             let temp = {};
            //             let tempList = [];
            //             data.list.forEach((value, index) => {
            //                 temp = {
            //                     dataInfo: value.dataInfo,
            //                     hadLiked: value.hadLiked,
            //                     belongStoreInfo: value.belongStoreInfo,
            //                     directChannel: value.directChannel,
            //                     mediaContents: value.promotionInfo.mediaContents,
            //                     mediaType: value.promotionInfo.mediaType,
            //                     paginationType: 2,
            //                     id: value.promotionInfo.promotionId,
            //                     isNeedContentShare: false,
            //                     storeId: that.storeId,
            //                     isNeedLocation: true,
            //                     isNeedLike: true,
            //                     isNeedComment: false,
            //                     isNeedShare: true,
            //                     isNeedServer: false,
            //                 };
            //                 tempList.push(temp);
            //                 that.couponsRedDeal(value, index);
            //             })
            //             this.activity.rtCommont = tempList;
            //             this.dealActivityMsg(data);
            //         } else if (data.errMsg) {
            //             this.$root.$emit("toast", {msg: data.errMsg})
            //         } else {
            //             this.$root.$emit("toast", {msg: '获取页面信息出错'})
            //         }
            //     });
            // },
            // initGoodsMsg(obj) {
            //     let that = this;
            //     let isNotHref = obj && obj.notHref;
            //     if (!isNotHref) {
            //         this.tapList(obj);
            //     }
            //     this.shareType = 3;
            //     let shareId = 3; //----对应分享类型需要传的ID： 1： 媒体ID 2： 活动id 3:商品id 4:买家秀ID 5: 大师ID
            //     let classId = obj && obj.classId ? obj.classId : 0;
            //     let pageNum = obj && obj.curPage ? obj.curPage : 1;
            //     let headItemId = this.$route.query && this.$route.query.shareId ? this.$route.query.shareId : null;
            //     // let url = `${this.NW_API_API_LOCALE_VERSION}/item/list/store/${this.storeId}`;
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/website/store/${this.storeId}/item/list`;
            //     let storeGoodsMsg = that.goods.goodsMsg;
            //     let paramas = {
            //         "pageNum": pageNum,
            //         "pageSize": that.goods.goodsMsg.pageSize,
            //         "classId": classId,
            //         "userId": that.userId,
            //         // "sort": "summary:desc",
            //         "headItemId": headItemId
            //     };
            //     that.xurl.postDataJsonLoading(url, paramas, false).then((data) => {
            //         if (data.success) {
            //             let tempObj = {storeId: that.storeId, isNeedServer: false};
            //             let goodsTempObj = {classId: classId, totalPages: data.totalPages};
            //
            //             if (obj && obj.isMore) {
            //                 if (that.goods.goodsMsg.list.length >= that.goods.goodsMsg.pageSize && data && data.list && data.list.length > 0) {
            //                     goodsTempObj.list = that.goods.goodsMsg.list;
            //                     goodsTempObj.list.push(...data.list);
            //                 }
            //             } else {
            //                 if (data.list) {
            //                     that.goods.goodsMsg.list = data.list;
            //                 } else {
            //                     that.goods.goodsMsg.list = [];
            //                 }
            //             }
            //             if (this.$refs.storeGoods && this.$refs.storeGoods[0]) {
            //                 this.$refs.storeGoods[0].closeSlideBottom(!this.$refs.storeGoods[0].slideSmallShow);
            //             }
            //             if (!data.list && obj && obj.isMore) {
            //                 return
            //             }
            //             this.goods.goodsMsg = Object.assign({}, this.goods.goodsMsg, data, goodsTempObj);
            //             this.goods.rtCommont = Object.assign({}, this.goods.rtCommont, data, this.storeMsg, tempObj);
            //         } else if (data.errMsg) {
            //             this.$root.$emit({msg: data.errMsg})
            //         } else {
            //             this.$root.$emit({msg: "获取页面信息失败"})
            //         }
            //     });
            // },
            /*好评/买家秀*/
            // initCommentMsg(obj) {
            //     let that = this;
            //     this.shareType = 4;
            //     let shareId = 4; //----对应分享类型需要传的ID： 1： 媒体ID 2： 活动id 3:商品id 4:买家秀ID 5: 大师ID
            //     this.tapList(obj);
            //     let url = `${that.NW_API_API_LOCALE_VERSION}/store/${that.storeId}/buyer/show/list?userId=${this.userId}&pageSize=${5}&pageNum=${1}`;
            //     that.xurl.getLoading(url).then((data) => {
            //         if (data.success) {
            //             let temp = {};
            //             let tempList = [];
            //             for (let value of data.list) {
            //                 temp = {
            //                     dataInfo: value.dataInfo,
            //                     hadLiked: value.hadLiked,
            //                     mediaContents: value.mediaContents,
            //                     mediaComment: value.mediaComment,
            //                     userName: value.userName,
            //                     mediaType: value.mediaType,
            //                     id: value.id,
            //                     isNeedContentShare: false,
            //                     storeId: that.storeId,
            //                     isNeedLocation: true,
            //                     isNeedLike: true,
            //                     isNeedComment: false,
            //                     isNeedShare: true,
            //                     isNeedServer: false,
            //                 };
            //                 tempList.push(temp);
            //             }
            //             this.comment.rtCommont = tempList;
            //             this.comment.commontMsg = Object.assign({}, this.comment.commontMsg, data);
            //         } else if (data.errMsg) {
            //             that.$root.$emit('toast', {msg: data.errMsg})
            //         } else {
            //             that.$root.$emit('toast', {msg: '获取数据出错'})
            //         }
            //     })
            // },
            // initBigMaster(obj) {
            //     /**/
            //     let that = this;
            //     this.shareType = 5;
            //     let shareId = 5; //----对应分享类型需要传的ID： 1： 媒体ID 2： 活动id 3:商品id 4:买家秀ID 5: 大师ID
            //     let classId = obj && (obj.classId || obj.classId == 0) ? obj.classId : -1;
            //     let pageNum = obj && obj.pageNum ? obj.pageNum : 1;
            //     let tempObj = {
            //         storeId: this.storeId,
            //         classId: classId,
            //         pageNum: pageNum,
            //         menuId: obj.menuId,
            //         userId: this.userId,
            //     }
            //     this.masterListApi(tempObj);
            //     // let url = `${that.NW_API_API_LOCALE_VERSION}/big/master/query/store/${this.storeId}/menu/${obj.menuId}/${classId}?pageSize=5&pageNum=${pageNum}&userId=${this.userId}`;
            //     this.tapList(obj);
            //     // that.xurl.getLoading(url).then((data)=>{
            //     //     let msg = data.list;
            //     //     let tempList = [];
            //     //     let tempStoreMsg = {};
            //     //     if(Array.isArray(msg) && msg.length > 0){
            //     //         msg.forEach((value, index) => {
            //     //             tempStoreMsg = {
            //     //                 dataInfo:value.dataInfo,
            //     //                 hadLiked:value.hadLiked,
            //     //                 mediaContents:value.mediaContents,
            //     //                 mediaType:value.mediaType,
            //     //                 paginationType:2,
            //     //                 id:value.id,
            //     //                 isNeedContentShare:false,
            //     //                 storeId:that.storeId,
            //     //                 isNeedLocation:true,
            //     //                 isNeedLike:true,
            //     //                 isNeedComment:false,
            //     //                 isNeedShare:true,
            //     //                 isNeedServer:false,
            //     //             };
            //     //             tempList.push(tempStoreMsg);
            //     //         })
            //     //         let tempObj = {
            //     //             // headerMsg: 'moudule1',
            //     //             list:tempList,
            //     //         }
            //     //         that.master.rtCommont = tempList;
            //     //         this.dealMasterMsg(data);
            //     //     }
            //     // });
            // },
            // initPlayerDirect(obj) {
            //     // if(!this.userId){
            //     //     this.$router.push('/to/login');
            //     // }
            //     let tempObj = {
            //         storeId: this.storeId || 0,
            //         userId: this.userId || 0,
            //     }
            //     obj = Object.assign({}, obj, tempObj);
            //     this.playChannelApi(obj);
            //     this.tapList(obj);
            // },
            // dealMaster(data) {
            //     console.log(data);
            // },
            // dealActivityMsg(data) {
            //     let msg = data.list;
            //     let that = this;
            //     // if(msg && Array.isArray(msg)){
            //     //     for(let value in msg){
            //     //         msg[value].promotionInfo.mediaId = msg[value].promotionInfo.promotionId;
            //     //         this.activity.activityMsg.list.push(msg[value].promotionInfo);
            //     //     }
            //     // }
            //
            //     let tempList = [];
            //     let tempStoreMsg = {};
            //     let promotionInfo = {};
            //     let promotionFloats = [];
            //     msg.forEach((value, index) => {
            //         promotionInfo = value.promotionInfo;
            //         promotionFloats = value.promotionFloats;
            //         if (!(Array.isArray(promotionFloats) && promotionFloats.length > 0 && promotionFloats[0])) {
            //             promotionFloats = [{}]
            //         }
            //         let actInfo = promotionFloats[0].actInfo;
            //         tempStoreMsg = {
            //             "promotionId": promotionInfo.promotionId,
            //             "mediaId": promotionInfo.promotionId,
            //             "mediaType": promotionInfo.mediaType,
            //             "mediaContents": promotionInfo.mediaContents,
            //             "poster": promotionInfo.poster,
            //
            //             "hasWelPacket": !!promotionInfo.packetInfo,
            //             "welPacketId": promotionFloats[0].welPacketId,
            //             "packetInfo": promotionFloats[0].packetInfo,
            //             "welPacketIco": promotionFloats[0].floatIco,
            //             "hasTicket": !!promotionFloats[0].templateTickets,
            //             // "ticketTemplateIds": promotionInfo.ticketTemplateIds,
            //             "templateTickets": promotionFloats[0].templateTickets,
            //             "ticketIco": promotionFloats[0].floatIco,
            //             "actInfo": actInfo,
            //             "hasActivity": !!actInfo,
            //             "actType": promotionFloats[0].actType,
            //             "actKey": actInfo && actInfo.actKey ? actInfo.actKey : 0,
            //             "actTitle": actInfo && actInfo.actTitle ? actInfo.actTitle : '',
            //             "actUrl": actInfo && actInfo.actUrl ? actInfo.actUrl : '',
            //             "actIco": promotionFloats[0].floatIco,
            //             "belongStoreInfo": value.belongStoreInfo,
            //             "shareBodyInfo": value.shareBodyInfo,
            //         };
            //         tempList.push(tempStoreMsg);
            //         msg[index].promotionInfo.mediaId = msg[index].promotionInfo.promotionId;
            //         that.activity.activityMsg.list.push(msg[index].promotionInfo);
            //     })
            //     let tempObj = {
            //         // headerMsg: 'moudule1',
            //         list: tempList,
            //     }
            //     that.activity.activityMsg = Object.assign({}, that.activity.activityMsg, tempObj);
            //
            //     // this.activity.activityMsg = Object.assign({},this.activity.activityMsg,{shareBodyInfo:data.shareBodyInfo});
            // },
            // couponsRedDeal(obj, index) {
            //     let that = this;
            //     let tempPromotionList = obj.promotionFloats;
            //     let couponsProps = [];
            //     let tempTicketObj = {};
            //     let tempObjItem = {};
            //     /*卡券*/
            //     if (Array.isArray(tempPromotionList) && tempPromotionList.length > 0) {
            //         tempPromotionList.forEach((promotionItem, promotionIndex) => {
            //             if (promotionItem.templateTickets) {
            //                 for (let value in promotionItem.templateTickets) {
            //                     let tempObjItem = {
            //                         templateId: promotionItem.templateTickets[value].templateTicketId,
            //                         state: promotionItem.templateTickets[value].state,
            //                         startTime: promotionItem.templateTickets[value].startTime,
            //                         endTime: promotionItem.templateTickets[value].endTime,
            //                         ticketType: promotionItem.templateTickets[value].type,
            //                         scope: promotionItem.templateTickets[value].scope,//使用范围
            //                         storeIcon: promotionItem.templateTickets[value].logo,
            //                         promotionId: promotionItem.promotionId,
            //                         condition: promotionItem.templateTickets[value].condition
            //                     };
            //                     couponsProps.splice(value, 1, tempObjItem);
            //                 }
            //                 /*红包*/
            //             } else if (promotionItem.packetInfo) {
            //                 let temp = {};
            //                 // temp.rule = ['邀好友开红包','每成功邀请1次<br/>可领1次红包','进APP提现'];
            //                 // 普通红包且没有领取的时候只显示领取//是否有可领金额在组件内部处理
            //                 if (promotionItem.packetInfo.welPacketType == 0) {
            //                     temp.showGetMoneyBtn = false;//红包提现按钮
            //                     temp.showGetBtn = true;
            //                     temp.showShareBtn = false;
            //                     /*助力红包*/
            //                 } else if (promotionItem.packetInfo.welPacketType == 1) {
            //                     /*成长红包*/
            //                     temp.showGetMoneyBtn = false;//红包提现按钮
            //                     temp.showGetBtn = true;
            //                     temp.showShareBtn = false;
            //                 } else if (promotionItem.packetInfo.welPacketType == 2) {
            //                     temp.showGetMoneyBtn = false;//红包提现按钮
            //                     temp.showGetBtn = true;
            //                     temp.showShareBtn = false;
            //                 }
            //
            //                 let tempObjItem = {
            //                     title: promotionItem.packetInfo.title,
            //                     redTypeState: promotionItem.packetInfo.welPacketType,
            //                     rule: [],
            //                     myPacketInfo: {
            //                         receivedAmount: promotionItem.packetInfo.receivedAmount,//
            //                         welPacketId: promotionItem.packetInfo.welPacketId,
            //                         completeReceived: promotionItem.packetInfo.canReceive,
            //                         canReceiveAmount: promotionItem.packetInfo.canReceiveAmount,//
            //                         showReceivedAmount: promotionItem.packetInfo.showReceivedAmount,
            //                         canReceive: promotionItem.packetInfo.canReceive,
            //                         lastTimeMillis: promotionItem.packetInfo.lastTimeMillis,//
            //                         invitedNum: promotionItem.packetInfo.invitedNum,//已经邀约人数
            //                         waitInvitedNum: promotionItem.packetInfo.waitInvitedNum,//剩余邀请人数
            //                         packetHelpers: promotionItem.packetInfo.packetHelpers//增长金额
            //                     },
            //                 };
            //                 // couponsProps = tempObjItem;
            //                 couponsProps.splice(index, 1, tempObjItem);
            //             } else if (!(promotionItem.packetInfo || promotionItem.templateTickets)) {
            //                 couponsProps.splice(index, 1, {});
            //             }
            //         })
            //     }
            //     tempTicketObj = {
            //         isShow: false,
            //         couponsProps,
            //     }
            //     that.couponsList.splice(index, 1, tempTicketObj);
            // },

            /*主评论获取*/
            // getUserMainComment(obj) {
            //     this.commentKey = obj && obj.commentKey ? obj.commentKey : this.commentKey;
            //     this.commentPageNum = obj && obj.checkCurPage ? obj.checkCurPage : 1;
            //     /*commentType  0-用户多媒体信息  1-店铺官网媒体  2-店铺活动    3-店铺商品  4-买家秀  5-大师*/
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/comment/user/${this.userId}/query/main?commentType=${this.commentType}&&commentKey=${this.commentKey}&&pageNum=${this.commentPageNum}&&pageSize=${this.commentPageSize}`;
            //     this.xurl.get(url).then((data) => {
            //         if (data.success) {
            //             if (obj && obj.isLoadingMore) {
            //                 /*加载更多*/
            //                 /*把commentListProps替换掉，里面的list push*/
            //                 let tempList = this.commentListProps.list;
            //                 tempList.push(...data.list);
            //                 data.list = tempList;
            //                 this.commentListProps = Object.assign({}, this.commentListProps, data);
            //             } else {
            //                 /*获取第一页*/
            //                 if (this.commentListProps && !this.commentListProps.children) {
            //                     this.commentListProps = data;
            //                 }
            //             }
            //         } else if (data.errMsg) {
            //             this.$root.$emit({msg: data.errMsg})
            //         } else {
            //             this.$root.$emit({msg: "获取页面信息失败"})
            //         }
            //     });
            // },
            /*子评论获取*/
            // getSubCommentList(obj) {
            //     let that = this;
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/comment/user/${this.userId}/query/sub?commentMainId=${obj.mainId}&&pageNum=${obj.pageNum}&&pageSize=${5}`;
            //     this.xurl.get(url).then((data) => {
            //         let tempObj = {
            //             children: data,
            //         }
            //         if (data.success) {
            //             /*把获取到的子评论加人到主评论对像的children里面去*/
            //             for (let value in that.commentListProps.list) {
            //                 if (that.commentListProps.list[value].id == obj.mainId) {
            //                     if (obj.isMore) {
            //                         let tempList = that.commentListProps.list[value].children.list;
            //                         tempList.push(...data.list);
            //                         tempObj.children.list = tempList;
            //                         that.commentListProps.list[value] = Object.assign({}, that.commentListProps.list[value], tempObj);
            //                         that.commentListProps.list.splice(value, 1, that.commentListProps.list[value]);
            //                     } else {
            //                         that.commentListProps.list[value] = Object.assign({}, that.commentListProps.list[value], tempObj);
            //                         that.commentListProps.list.splice(value, 1, that.commentListProps.list[value]);
            //                     }
            //                     break;
            //                 }
            //             }
            //         } else if (data.errMsg) {
            //             this.$root.$emit({msg: data.errMsg})
            //         } else {
            //             this.$root.$emit({msg: "获取页面信息失败"})
            //         }
            //     });
            // },
            /*评论*/
            // doComment(obj) {
            //     let url = '';
            //     let paramas = {};
            //     let that = this;
            //     if (!obj.content || !obj.content.trim()) {
            //         this.$root.$emit('toast', {msg: "评论内容不能为空！"})
            //         return;
            //     }
            //     /*主评论*/
            //     if (obj.belongType < 0) {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/comment/user/${this.userId}/add/main`;
            //         paramas = {
            //             commentType: that.commentType,
            //             commentKey: that.commentKey,
            //             content: obj.content,
            //         }
            //     } else {
            //         /*子评论*/
            //         url = `${this.NW_API_API_LOCALE_VERSION}/comment/user/${this.userId}/add/sub`;
            //         paramas = {
            //             commentMainId: obj.mainId,
            //             commentSubId: parseInt(obj.subId) > 0 ? obj.subId : null,
            //             content: obj.content,
            //         };
            //     }
            //     this.xurl.postDataJsonLoading(url, paramas, false).then((data) => {
            //         if (data.success) {
            //             if (obj.belongType < 0) {
            //                 this.getUserMainComment();
            //             } else {
            //                 /*子评论*/
            //                 obj.pageNum = 1;
            //                 this.getSubCommentList(obj);
            //             }
            //             if (obj && obj.cb) {
            //                 obj.cb();
            //             }
            //         }
            //         // else if(data.err){
            //         //     this.$root.$emit("toast",{msg:'评论失败'})
            //         // }
            //     })
            // },
            // isLike(obj) {
            //     let that = this;
            //     // http://192.168.1.163:7280/nw_api/api/zh/v1.00/like/user/2004/do?likeType=2&&likeKey=3677
            //     //http://192.168.1.163:7280/nw_api/api/zh/v1.00/like/user/2004/do?likeType=2&&likeKey=31
            //     //0-主评论  1-子评论  2-店铺官网媒体   3-店铺商品  4-店铺活动  5-买家秀  6-大师  10-用户多媒体信息
            //     //菜单类型：1纯媒体 2活动 3商品 4买家秀 5大师
            //
            //     let likeType = -1;
            //     /*主子评论点赞*/
            //     if (obj && Object.keys(obj).includes('mainkey')) {
            //         if (Object.keys(obj).includes('subKey')) {
            //             likeType = 1;
            //         } else {
            //             likeType = 0;
            //         }
            //     } else {
            //         switch (that.tMenuType) {
            //             case 1:
            //                 likeType = 2;
            //                 break;
            //             case 2:
            //                 likeType = 4;
            //                 break;
            //             case 3:
            //                 likeType = 3;
            //                 break;
            //             case 4:
            //                 likeType = 5;
            //                 break;
            //             case 5:
            //                 likeType = 6;
            //                 break;
            //             /*媒体点赞*/
            //             default:
            //                 likeType = 10;
            //                 break;
            //         }
            //     }
            //     let url = '';
            //     if (obj.isLike) {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/like/user/${this.userId}/do?likeType=${likeType}&likeKey=${obj.likeKey}`
            //     } else {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/like/user/${this.userId}/cancel?likeType=${likeType}&likeKey=${obj.likeKey}`
            //     }
            //     this.xurl.put(url).then((data) => {
            //         if (data.success) {
            //             console.log(data)
            //         } else {
            //             console.log("点赞失败")
            //         }
            //     })
            // },
            // tapList(obj) {
            //     return
            //     let that = this;
            //     //改变路由的后缀
            //     let routerPath = this.$router.path;
            //     let query = this.$router.history.current.query;
            //     this.storeId = that.storeId || 0;
            //     this.menuType = obj.menuType || 0;
            //     this.menuId = obj.menuId || 0;
            //     let queryMsg = {
            //         storeId: that.storeId,
            //         menuType: obj.menuType,
            //         menuId: obj.menuId,
            //     };
            //     /*TODO 这里可能会出现分享之后不会刷出对应的视频*/
            //     if (!this.isInit && query && Object.keys(query).includes('shareId')) {
            //         delete query.shareId
            //     }
            //     this.isInit = false;
            //     queryMsg = Object.assign({}, query, queryMsg);
            //     this.$router.push({path: routerPath, query: queryMsg});
            // },
            tapmenu(obj,isClick){
                /*路由相同的情况*/
                let that = this;
                let scrollPosition = 0;
                that.menus.forEach((value, index) => {
                    if (value.menuId == obj.menuId) {
                        that.menus[index].defaultShow = true;
                        setTimeout(() => {
                            if (that.$refs.menuItem && that.$refs.menuItem[index]) {
                                scrollPosition = that.$refs.menuItem[index].offsetLeft;
                                that.$refs.headerBanner.scrollLeft = scrollPosition - document.documentElement.clientWidth / 375 * 80;
                            }
                        }, 100)
                    } else {
                        that.menus[index].defaultShow = false;
                    }
                    that.menus[index] = Object.assign({}, that.menus[index]);
                });
                that.menus.splice(0, 1, that.menus[0]);
                that.commentType = obj.menuType;
                let needCloseChild = false;
                if(obj.menuType == this.menuType && obj.menuId != this.menuId && isClick){
                    if(obj){
                        this.showChild = false;
                    }
                    let tempObj = {
                        storeId: this.storeId,
                        menuType: obj.menuType,
                        menuId: obj.menuId,
                        menus: this.menus,
                    };
                    this.updateStoreMenu(tempObj);
                    setTimeout(()=>{
                        this.showChild = true;
                        this.menuType = obj.menuType
                        this.menuId = obj.menuId
                        this.$router.push({path:this.toPath(obj),query:{storeId:this.storeId,menuType:obj.menuType,menuId:obj.menuId}});
                    },50)
                }else{
                    this.menuType = obj.menuType
                    this.menuId = obj.menuId
                    this.$router.push({path:this.toPath(obj),query:{storeId:this.storeId,menuType:obj.menuType,menuId:obj.menuId}});
                }

            },
            // openRedPage(obj, callback) {
            //     let that = this;
            //     if (!this.userId) {
            //         this.$router.push('/to/login');
            //         return
            //     }
            //     let url = "";
            //     /*普通红包*/
            //     if (obj && obj.welPacketType == 0) {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/welfare/direct/packet/receive?userId=${this.userId}&giveChannel=${this.giveChannel}&welPacketId=${obj.welPacketId}`;
            //         /*助力红包*/
            //     } else if (obj && obj.welPacketType == 1) {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/welfare/help/packet/receive?userId=${this.userId}&welPacketId=${obj.welPacketId}`
            //         /*成长红包*/
            //     } else if (obj && obj.welPacketType == 2) {
            //         url = `${this.NW_API_API_LOCALE_VERSION}/welfare/grow/packet/receive?userId=${this.userId}&welPacketId=${obj.welPacketId}`
            //     }
            //     this.xurl.put(url).then((data) => {
            //         if (data.success) {
            //             for (let value in that.couponsList) {
            //                 if (that.couponsList[value].couponsProps.myPacketInfo && obj.welPacketId == that.couponsList[value].couponsProps.myPacketInfo.welPacketId) {
            //                     that.couponsList[value].couponsProps.myPacketInfo.canReceive = false;
            //                     that.couponsList[value].couponsProps.myPacketInfo.showReceivedAmount = true;
            //                     that.couponsList[value].couponsProps.myPacketInfo.receivedAmount = data.result;
            //                     that.couponsList[value].couponsProps.getBtnActive = false;
            //                     if (callback) {
            //                         callback();
            //                     }
            //                     that.couponsList.splice(value, 1, that.couponsList[value]);
            //                 }
            //             }
            //         } else if (data.errMsg) {
            //             this.$root.$emit("toast", {msg: data.errMsg})
            //         } else {
            //             this.$root.$emit("toast", {msg: '领取红包失败'})
            //         }
            //     })
            // },
            // getTemplate(index, obj, cb) {
            //     //data-couponsId
            //     let that = this;
            //     if (!this.userId) {
            //         this.$router.push({path: '/to/login', query: {'isToPhoneLogin': true}});
            //     } else {
            //         if (obj.state === 0) {
            //             let url = `${this.NW_API_API_LOCALE_VERSION}/user/ticket/${obj.templateId}/receive/user/${this.userId}`;
            //             this.post(url).then((data) => {
            //                 if (data.success) {
            //                     if (cb) {
            //                         cb();
            //                     }
            //                     //这里是否需要刷新
            //                     // this.$emit("refresh");
            //                     that.couponsList.forEach((value, index) => {
            //                         if (Array.isArray(value.couponsProps)) {
            //                             value.couponsProps.forEach((couponsItem, couponsIndex) => {
            //                                 if (couponsItem.templateId == obj.templateId) {
            //                                     that.couponsList[index].couponsProps[couponsIndex].state = 7;
            //                                     that.couponsList = that.couponsList.splice(index, 1, that.couponsList[index]);
            //                                     let couponsList = that.couponsList;
            //                                     setTimeout(() => {
            //                                         that.couponsList = [];
            //                                         setTimeout(() => {
            //                                             that.couponsList = couponsList;
            //                                         }, 10)
            //                                     }, 1000)
            //                                 }
            //                             })
            //                         }
            //                     })
            //                     this.$root.$emit('toast', {msg: '领取成功'})
            //                 } else if (data.errMsg) {
            //                     this.$root.$emit('toast', {msg: data.errMsg})
            //                 } else {
            //                     this.$root.$emit('toast', {msg: '领取失败'})
            //                 }
            //             })
            //         } else if (obj.state === 6) {
            //             //优惠券详情页面/coupon/template/detail/
            //             // this.$router.push({path:'/coupon/template/detail/'+obj.templateId+'/none'})
            //         } else {
            //             this.$root.$emit('toast', {msg: "此券不可领取"});
            //         }
            //     }
            // },
            // suspensionCb(index) {
            //     let tempObj = this.couponsList[index];
            //     let tempObj1 = {
            //         isShow: false
            //     }
            //     tempObj = Object.assign({}, tempObj, tempObj1);
            //     this.couponsList.splice(index, 1, tempObj)
            // },
            // animationCb(index) {
            //     let tempObj = this.couponsList[index];
            //     let tempObj1 = {
            //         isShow: true
            //     };
            //     tempObj = Object.assign({}, tempObj, tempObj1);
            //     this.couponsList.splice(index, 1, tempObj)
            // },
            // getAllCounponsFn(obj, cb) {
            //     if (!this.userId) {
            //         this.$router.push({path: '/to/login', query: {'isToPhoneLogin': true}});
            //         return
            //     }
            //     let tempI = 0;
            //     let that = this;
            //     let url = `${this.NW_API_API_LOCALE_VERSION}/user/ticket/batch/receive/user/${this.userId}`;
            //     let templatIds = [];
            //     for (let value of obj) {
            //         if (value.state == 0) {
            //             templatIds.push(value.templateId);
            //         }
            //     }
            //     let params = {
            //         ids: templatIds
            //     };
            //     if (templatIds.length == 0) {
            //         this.$root.$emit('toast', {msg: `领取失败或不可领取`});
            //         return;
            //     }
            //     let i = 0;
            //     let time = '';
            //     if (cb) {
            //         cb();
            //     }
            //     this.postDataJsonLoading(url, params, false).then((data) => {
            //         if (data.success) {
            //             if (data.result.failNum && data.result.successNum) {
            //                 time = setInterval(() => {
            //                     // that.templateHide(i);
            //                     for (let value in that.$refs.coupons) {
            //                         for (let objValue in obj) {
            //                             if (obj[objValue].promotionId == that.$refs.coupons[value].templates[0].promotionId) {
            //                                 that.$refs.coupons[value].templateHide(objValue, obj[objValue]);
            //                             }
            //                         }
            //                     }
            //                     that.couponsList.forEach((value, index) => {
            //                         if (Array.isArray(value.couponsProps)) {
            //                             value.couponsProps.forEach((couponsItem, couponsIndex) => {
            //                                 obj.forEach((AryValue, AryIndex) => {
            //                                     if (couponsItem.templateId == AryValue.templateId && that.couponsList[index] && that.couponsList[index].couponsProps) {
            //                                         that.couponsList[index].couponsProps[couponsIndex].state = 7;
            //                                         if (tempI == 0) {
            //                                             tempI = 1
            //                                             let couponsList = that.couponsList;
            //                                             setTimeout(() => {
            //                                                 setTimeout(() => {
            //                                                     that.couponsList = couponsList;
            //                                                 }, 10)
            //                                             }, 1000)
            //                                         }
            //                                     }
            //                                 })
            //                             })
            //                         }
            //                     })
            //                     i++;
            //                     if (i >= obj.length) {
            //                         clearInterval(time)
            //                         i = 0
            //                     }
            //                 }, 400);
            //                 this.$root.$emit('toast', {msg: `成功领取${data.result.successNum}张券，${data.result.failNum}未领取`});
            //                 setTimeout(() => {
            //                     this.getPageMsg();
            //                 }, 1500)
            //             } else if (!data.result.failNum && data.result.successNum) {
            //                 time = setInterval(() => {
            //                     /*定位是那个页面的劵*/
            //                     for (let value in that.$refs.coupons) {
            //                         for (let objValue in obj) {
            //                             if (obj[objValue].promotionId == that.$refs.coupons[value].templates[0].promotionId) {
            //                                 that.$refs.coupons[value].templateHide(objValue, obj[objValue]);
            //                             }
            //                         }
            //                     }
            //                     that.couponsList.forEach((value, index) => {
            //                         if (Array.isArray(value.couponsProps)) {
            //                             value.couponsProps.forEach((couponsItem, couponsIndex) => {
            //                                 obj.forEach((AryValue, AryIndex) => {
            //                                     if (couponsItem.templateId == AryValue.templateId && that.couponsList[index] && that.couponsList[index].couponsProps) {
            //                                         that.couponsList[index].couponsProps[couponsIndex].state = 7;
            //                                         if (tempI == 0) {
            //                                             tempI = 1
            //                                             let couponsList = that.couponsList;
            //                                             setTimeout(() => {
            //                                                 setTimeout(() => {
            //                                                     that.couponsList = couponsList;
            //                                                 }, 10)
            //                                             }, 1000)
            //                                         }
            //                                     }
            //                                 })
            //                             })
            //                         }
            //                     })
            //                     i++;
            //                     if (i >= obj.length) {
            //                         clearInterval(time)
            //                         i = 0
            //                     }
            //                 }, 400);
            //                 this.$root.$emit('toast', {msg: `成功领取${data.result.successNum}张券`});
            //                 setTimeout(() => {
            //                     this.$emit("refresh");
            //                 }, 1500)
            //             } else if (!data.result.successNum && data.result.failNum) {
            //                 this.$root.$emit('toast', {msg: `领取失败或不可领取`});
            //             }
            //         } else if (data.errMsg) {
            //             this.$root.$emit('toast', {msg: data.errMsg});
            //         } else {
            //             this.$root.$emit('toast', "领取失败");
            //         }
            //     })
            // },
            doAttention(concernType, concernKey, key, cb, isCancelAttention) {
                if (!this.userId) {
                    this.$router.push('/to/login');
                    return;
                }
                let that = this;
                let url = `${that.NW_API_API_LOCALE_VERSION}/concern/user/${this.userId}/do?concernType=${concernType}&&concernKey=${concernKey}`;
                let isDoConcerned = true;
                let attentionText = '关注成功';
                if (isCancelAttention) {
                    url = `${that.NW_API_API_LOCALE_VERSION}/concern/user/${this.userId}/cancel?concernType=${concernType}&&concernKey=${concernKey}`;
                    isDoConcerned = false;
                    attentionText = '取消关注成功'
                }
                this.xurl.put(url).then((data) => {
                    if (data.success) {
                        this.$root.$emit('toast', {msg: attentionText});
                        that.storeMsg.concerned = isDoConcerned;
                        if (cb) {
                            cb();
                        }
                    } else if (data.errMsg) {
                        this.$root.$emit('toast', {msg: data.errMsg})
                    } else {
                        this.$root.$emit('toast', {msg: '关注失败'})
                    }
                });
            },
            getHeaderItem(msg, index) {
                let that = this;
                let tempObj = {
                    nowSwiperIndex: 0,
                    belongSwiperIndex: 0,
                    headerType: 'moudule1',
                    swiperLength: 1,
                    rightType: 'storeHome',
                    isNeedCancleAtt: true,
                }
                // belongUserInfo: {
                //     userId: 0,
                //     photo: '',
                //     userName: '',
                // },
                // mediaType:0,//表示视频，1表示轮播图
                // mediaContents:[
                //     {url:''}
                // ],
                // nowSwiperIndex:1,
                //belongSwiperIndex:0,
                //swiperLength:0,
                let storeHeaderMsg = {
                    belongStoreInfo: {
                        storeId: this.storeId,
                        logo: this.storeMsg.logo,
                        // promotionId: ,
                        concerned: this.storeMsg.concerned,
                        name: this.storeMsg.name,
                        userId: 1,
                        evaluateLevel: "0",
                        industry: this.storeMsg.industry
                    },
                }
                return Object.assign({}, storeHeaderMsg, tempObj)
            },
            // showMarsterDetail() {
            //     let that = this;
            //     this.bottomSuspensionShow = true;
            //     this.swiperIndex = this.$refs.master[0].swiperIndex;
            //     setTimeout(() => {
            //         that.$refs.bottomSuspension[0].showMarsterDetail()
            //     }, 50)
            // },
            // showMarsterClassify(obj) {
            //     let that = this;
            //     this.bottomSuspensionShow = true;
            //     this.swiperIndex = this.$refs.master[0].swiperIndex;
            //     setTimeout(() => {
            //         that.$refs.bottomSuspension[0].showMarsterClassify(obj)
            //     }, 50)
            // },
            // toSwiperIndex(key) {
            //     if (this.$refs.master && this.$refs.master[0]) {
            //         this.$refs.master[0].toSwiperIndex(key);
            //     }
            // },
        },
        watch: {
            // '$route'(to, from) {
            //     this.$router.go(0);
            // },
            shareBody(val) {

            },
        },
        components: {
            // 'mt-navbar': Navbar,
            // 'mt-tab-item': TabItem,
            // 'store-panorama': StorePanorama,
            // 'store-goods': StoreGoods,
            // 'store-activity': FullImgVideoSwiper,
            // 'store-comment': FullImgVideoSwiper,
            // 'store-master': FullImgVideoSwiper,
            // 'bottom-suspension': () => import("./components/master/Bottom"),
            // 'video-float-footer': () => import("../../components/commonActModel/panoramaVideoSwiper/VideoFloatFooter"),
            // 'play-direct': PlayDirect,
            "v-share": () => import("../../components/commonComponents/share/Share"),
            "v-header": () => import("../../components/commonActModel/header/Header"),
            'wx-share-body': () => import('../../components/wx/WxShareBody'),
        },
    }
</script>

<style scoped lang="scss">
    .store-header-banner /deep/ {
        .fc-header {
            padding: .15rem 0;
            position: relative;
        }
    }

    .store-header {
        background-image: -webkit-linear-gradient(rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 100%);
        background-image: linear-gradient(rgba(0, 0, 0, .3) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 100%);
        height: 6.67rem;
        height: 100vh;
    }

    .content-wrap /deep/ {
        .goods-msg {
            background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .3) 100%);
            background-image: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .3) 100%);
        }
    }

    .store-header /deep/ {
        .look-index-mood {
            padding: 0;
            position: relative;
        }

        .no-wcomment {
            background-color: #202531;
        }

        .no-comment-text {
            color: #939599;
        }
    }

    .store-header-wrap {
        width: 3.75rem;
        padding: 0 .15rem;
        position: fixed;
        z-index: 1050;
        height: 1rem;
        background-image: linear-gradient(rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 100%);
    }

    .store-header-list {
        height: .3rem;
        white-space: nowrap;
    }

    .store-header-wlist {
        overflow: auto;
        height: .6rem;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        padding-bottom: .3rem;
    }

    .hidden-scroll {
        height: .3rem;
        overflow: hidden;
        padding: 0;
    }

    .under-line {
        height: 2px;
        width: .1rem;
        background-color: #fff;
        position: absolute;
        left: 0;
        right: 0;
        margin: auto;
        bottom: -.05rem;
        /*-webkit-transition: left .3s;*/
        /*-moz-transition: left .3s ;*/
        /*-ms-transition: left .3s ;*/
        /*-o-transition: left .3s ;*/
        /*transition: left .3s ;*/
    }

    .store-item {
        text-shadow: 0 0 .01rem #ccc;
        font-size: .16rem;
        text-align: left;
        padding: 0 .2rem;
        display: inline-block;
        font-weight: bold;
        color: rgba(255, 255, 255, .6);
    }

    .store-header-list .store-item:first-of-type {
        padding-left: .1rem;
    }

    .store-header-list .store-item:last-of-type {
        padding-right: .1rem;
    }

    .store-item.active {
        color: rgba(255, 255, 255, 1);
    }

    .icon-arrows_right {
        text-shadow: 0 0 .01rem #ccc;
        font-size: .2rem;
        color: rgba(255, 255, 255, 1);
    }

    .store-logo {
        width: .24rem;
        height: .24rem;
        object-fit: cover;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
    }

    .store-location {
        color: #fff;
        font-size: .1rem;
        position: absolute;
        left: 50%;
        -webkit-transform: translateX(-50%);
        -moz-transform: translateX(-50%);
        -ms-transform: translateX(-50%);
        -o-transform: translateX(-50%);
        transform: translateX(-50%);
        white-space: nowrap;
        bottom: -.2rem;

    }

    .small-circle {
        display: inline-block;
        width: 2px;
        height: 2px;

        img {
            width: 100%;
            position: absolute;
        }
    }

    .store-logo-bottom {
        width: 100%;
        color: #000;
        background-color: #fff;
        -webkit-border-radius: .25rem;
        -moz-border-radius: .25rem;
        border-radius: .25rem;
        padding: .01rem .02rem;
    }

    .store-msg {
        width: .24rem;
        position: relative;
    }
</style>